<template>
    <div>
        <!-- 推荐书籍 -->
        <show-books-item
            v-for="item in showBooks" 
            :booksBlock="item.data"
            :blockTitle="item.title"
            :iconType="item.icon"
            :key="item.id"
        ></show-books-item>
    </div>
</template>

<script> 

import showBooksItem from './showBooksItem.vue'
export default {
    name: 'showBooks',
    components: {
        showBooksItem
    },
    data() {
        return {
            showBooks : null
        }
    },
    mounted() {
        this.$axios.get('./static/showBooks.json').then(response => {
            this.showBooks = response.data.result;
        }, response => {
            console.log("error");
            alert('网络请求错误')
        });
    },
    methods: {

    }
}
</script>